/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package org.abc;

import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.TextStyle;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Locale;

/**
 * <p>Project: jse2303 - Ex11
 * <p>Powered by webrx On 2023-07-10 14:02:47
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex11 {
    public static void main(String[] args) {
        DayOfWeek dw = LocalDate.of(2023, 1, 1).getDayOfWeek();
        System.out.println(dw);
        System.out.println(dw.getDisplayName(TextStyle.FULL, Locale.CHINA));


        LocalDate d1 = LocalDate.of(2023, 1, 1);
        //String str = d1.format(DateTimeFormatter.ofPattern("EEEE", Locale.CHINA));
        String str = d1.format(DateTimeFormatter.ofPattern("EEEE"));
        System.out.println(str);

        LocalDate d2 = LocalDate.now();
        long nn = ChronoUnit.DAYS.between(d1, d2);
        System.out.println(nn);

        Calendar c = Calendar.getInstance();
        c.set(2023, 1 - 1, 1);
        long ss = c.getTimeInMillis();
        long now = System.currentTimeMillis();
        long s2 = now - ss;
        System.out.println(s2 / (1000 * 60 * 60 * 24));


    }
}
